<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>题目翻译器</title>
    <style>
        body {
            width: 320px;
            min-height: 200px;
            margin: 0;
            padding: 16px;
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
            background: #f8f9fa;
            color: #333;
        }

        .header {
            text-align: center;
            margin-bottom: 16px;
            padding-bottom: 12px;
            border-bottom: 1px solid #e0e0e0;
        }

        .header h1 {
            margin: 0;
            font-size: 18px;
            font-weight: 600;
            color: #2c3e50;
        }

        .status-section {
            margin-bottom: 16px;
        }

        .status-indicator {
            display: flex;
            align-items: center;
            padding: 12px;
            border-radius: 8px;
            font-size: 14px;
            margin-bottom: 8px;
        }

        .status-supported {
            background: #d4edda;
            color: #155724;
            border: 1px solid #c3e6cb;
        }

        .status-unsupported {
            background: #f8d7da;
            color: #721c24;
            border: 1px solid #f5c6cb;
        }

        .status-icon {
            margin-right: 8px;
            font-size: 16px;
        }

        .config-section {
            margin-bottom: 16px;
        }

        .config-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 8px 0;
            font-size: 13px;
        }

        .config-label {
            color: #666;
        }

        .config-value {
            font-weight: 500;
            color: #333;
        }

        .action-buttons {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        .btn {
            padding: 10px 16px;
            border: none;
            border-radius: 6px;
            font-size: 14px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s ease;
            text-align: center;
        }

        .btn-primary {
            background: #007bff;
            color: white;
        }

        .btn-primary:hover {
            background: #0056b3;
        }

        .btn-secondary {
            background: #6c757d;
            color: white;
        }

        .btn-secondary:hover {
            background: #545b62;
        }

        .btn:disabled {
            opacity: 0.6;
            cursor: not-allowed;
        }

        .loading {
            display: inline-block;
            width: 12px;
            height: 12px;
            border: 2px solid #ffffff;
            border-radius: 50%;
            border-top-color: transparent;
            animation: spin 0.8s linear infinite;
            margin-right: 6px;
        }

        @keyframes spin {
            to { transform: rotate(360deg); }
        }

        .footer {
            margin-top: 16px;
            padding-top: 12px;
            border-top: 1px solid #e0e0e0;
            text-align: center;
            font-size: 12px;
            color: #666;
        }
    </style>
</head>
<body>
    <div class="header">
        <h1>🌐 题目翻译器</h1>
    </div>

    <div class="status-section">
        <div id="statusIndicator" class="status-indicator">
            <span class="status-icon">⏳</span>
            <span id="statusText">检查页面支持状态...</span>
        </div>
    </div>

    <div class="config-section">
        <div class="config-item">
            <span class="config-label">翻译引擎:</span>
            <span id="engineConfig" class="config-value">-</span>
        </div>
        <div class="config-item">
            <span class="config-label">目标语言:</span>
            <span id="targetLangConfig" class="config-value">-</span>
        </div>
        <div class="config-item">
            <span class="config-label">配置状态:</span>
            <span id="configStatus" class="config-value">-</span>
        </div>
    </div>

    <div class="action-buttons">
        <button id="translateBtn" class="btn btn-primary" disabled>
            <span id="translateBtnText">翻译当前页面</span>
        </button>
        <button id="settingsBtn" class="btn btn-secondary">
            ⚙️ 设置
        </button>
    </div>

    <div class="footer">
        支持 Codeforces & AtCoder
    </div>

    <script src="popup.js"></script>
</body>
</html>